/**
 * Created by wangkui on 2016/1/26.
 */
var mongoose = require('mongoose'),
    Schema = mongoose.Schema;

var PanoSchema = new Schema({
    panoid:String,                  //全景图Id
    title:String,                       //标题
    description:String,                 //描述
    keywords:String,
    iconPath:String,
    thumbPath:String,
    tourxmlpath:String,
    template:{type: String, default: 'default'},                //模板
    pubDate:Date,
    status:String,
    pricingMode:String,
    previewpasswd:String,
    sequence:Number
});

//根据PanoId查询
PanoSchema.statics.findByPanoId = function(panoid, callback) {
    return this.model('Pano').findOne({panoid: panoid}, callback);
}

module.exports = mongoose.model('Pano', PanoSchema);